package com.spark.zhou.demo;

import org.apache.spark.SparkConf;
import org.apache.spark.api.java.JavaRDD;
import org.apache.spark.api.java.JavaSparkContext;

import java.util.Arrays;

/**
 * @Description: Spark中RDD初试
 * @Author: ZhOu
 * @Date: 2018/5/27
 */
public class RddDemo {

    public static void main(String[] args) {
        SparkConf sparkConf = new SparkConf().setAppName("RddDemo").setMaster("local");
        JavaSparkContext sc = new JavaSparkContext(sparkConf);
        JavaRDD<Integer> rdd = sc.parallelize(Arrays.asList(1, 2, 3, 4, 5), 3);
        rdd.collect().forEach(System.out::println);
        sc.close();
    }
}